#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/types.h> 
int g_val = 0;
int main()
{
  pid_t id = fork();
  if(id < 0){
    printf("fork error\n");
  }
  else if(id == 0)
  {
    printf("child[%d]: %d: %p\n",getpid(), g_val, &g_val);
  }
  else{
    printf("parent[%d]: %d: %p\n",getpid(), g_val, &g_val);
  }

  return 0;
}
